package com.ruoyi.mall.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.mapper.SpecificationsMapper;
import com.ruoyi.mall.domain.Specifications;
import com.ruoyi.mall.service.ISpecificationsService;

/**
 * 规格参数Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-13
 */
@Service
public class SpecificationsServiceImpl implements ISpecificationsService 
{
    @Autowired
    private SpecificationsMapper specificationsMapper;

    /**
     * 查询规格参数
     * 
     * @param specId 规格参数主键
     * @return 规格参数
     */
    @Override
    public Specifications selectSpecificationsBySpecId(Long specId)
    {
        return specificationsMapper.selectSpecificationsBySpecId(specId);
    }

    /**
     * 查询规格参数列表
     * 
     * @param specifications 规格参数
     * @return 规格参数
     */
    @Override
    public List<Specifications> selectSpecificationsList(Specifications specifications)
    {
        return specificationsMapper.selectSpecificationsList(specifications);
    }

    /**
     * 新增规格参数
     * 
     * @param specifications 规格参数
     * @return 结果
     */
    @Override
    public int insertSpecifications(Specifications specifications)
    {
        specifications.setCreateTime(DateUtils.getNowDate());
        return specificationsMapper.insertSpecifications(specifications);
    }

    /**
     * 修改规格参数
     * 
     * @param specifications 规格参数
     * @return 结果
     */
    @Override
    public int updateSpecifications(Specifications specifications)
    {
        specifications.setUpdateTime(DateUtils.getNowDate());
        return specificationsMapper.updateSpecifications(specifications);
    }

    /**
     * 批量删除规格参数
     * 
     * @param specIds 需要删除的规格参数主键
     * @return 结果
     */
    @Override
    public int deleteSpecificationsBySpecIds(Long[] specIds)
    {
        return specificationsMapper.deleteSpecificationsBySpecIds(specIds);
    }

    /**
     * 删除规格参数信息
     * 
     * @param specId 规格参数主键
     * @return 结果
     */
    @Override
    public int deleteSpecificationsBySpecId(Long specId)
    {
        return specificationsMapper.deleteSpecificationsBySpecId(specId);
    }
}
